#include "logger.h"
#include <QString>
#include <QDateTime>
#include <QDebug>

Log::Log(Type type, const QString& text)
{
    QString currentTime = QDateTime::currentDateTime().toString("[yyyy-MM-dd hh:mm:ss]");
    QString typeStr;

    switch(type) {
        case Type::Info:    typeStr = "[INFO]"; break;
        case Type::Warning: typeStr = "[WARNING]"; break;
        case Type::Error:   typeStr = "[ERROR]"; break;
    }

    qDebug().noquote() << currentTime << typeStr << text;
}
